/* RPG游戏化风格样式 */

/* ========== RPG卡片样式 ========== */
.rpg-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(245,247,250,0.95) 100%);
  border-radius: 16px;
  padding: 1.5rem;
  border: 2px solid rgba(0,0,0,0.1);
  box-shadow:
    0 10px 30px rgba(0,0,0,0.1),
    inset 0 1px 0 rgba(255,255,255,0.6);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.rpg-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--card-color-start, #2D6A4F) 0%,
    var(--card-color-end, #95D5B2) 100%);
  animation: shimmer 3s ease-in-out infinite;
}

.rpg-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 20px 40px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.8);
  border-color: var(--card-color-start, #2D6A4F);
}

/* 木材卡片配色 */
.wood-card {
  --card-color-start: #8B4513;
  --card-color-end: #DEB887;
}

/* 粮食卡片配色 */
.food-card {
  --card-color-start: #8BC34A;
  --card-color-end: #CDDC39;
}

/* 人口卡片配色 */
.people-card {
  --card-color-start: #F08080;
  --card-color-end: #FFA07A;
}

/* ========== 卡片头部 ========== */
.rpg-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.rpg-icon-container {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, var(--card-color-start) 0%, var(--card-color-end) 100%);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.2),
    inset 0 2px 4px rgba(255,255,255,0.3);
  color: white;
  animation: iconFloat 3s ease-in-out infinite;
}

.wood-glow { filter: drop-shadow(0 0 15px rgba(139, 69, 19, 0.6)); }
.food-glow { filter: drop-shadow(0 0 15px rgba(139, 195, 74, 0.6)); }
.people-glow { filter: drop-shadow(0 0 15px rgba(240, 128, 128, 0.6)); }

.icon-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255,255,255,0.3) 50%,
    transparent 60%
  );
  animation: iconShine 3s ease-in-out infinite;
}

.rpg-card-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.resource-label {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1a202c;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.resource-type {
  font-size: 0.75rem;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* ========== 卡片主体 ========== */
.rpg-card-body {
  margin-bottom: 1.25rem;
}

.resource-value-container {
  display: flex;
  align-items: baseline;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.resource-value {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--card-color-start) 0%, var(--card-color-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-family: 'Courier New', monospace;
}

.resource-separator {
  font-size: 2rem;
  color: #a0aec0;
  font-weight: 700;
}

.resource-value-max {
  font-size: 1.5rem;
  color: #718096;
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

.resource-unit {
  font-size: 0.875rem;
  color: #a0aec0;
  text-transform: uppercase;
}

/* ========== 进度条 ========== */
.resource-bar-container {
  position: relative;
  margin-bottom: 0.5rem;
}

.resource-bar-bg {
  position: relative;
  height: 16px;
  background: linear-gradient(to bottom, #e2e8f0 0%, #cbd5e0 100%);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.resource-bar {
  height: 100%;
  border-radius: 8px;
  position: relative;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 2px 6px rgba(0,0,0,0.2);
}

.wood-bar {
  background: linear-gradient(90deg, #8B4513 0%, #DEB887 100%);
}

.food-bar {
  background: linear-gradient(90deg, #8BC34A 0%, #CDDC39 100%);
}

.people-bar {
  background: linear-gradient(90deg, #F08080 0%, #FFA07A 100%);
}

.bar-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.6) 50%,
    transparent 100%
  );
  animation: barShine 2s ease-in-out infinite;
  animation-delay: 0.5s;
}

.resource-bar-text {
  display: block;
  font-size: 0.75rem;
  color: #4a5568;
  margin-top: 0.375rem;
  font-weight: 600;
}

/* ========== 卡片底部 ========== */
.rpg-card-footer {
  border-top: 1px solid rgba(0,0,0,0.05);
  padding-top: 1rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #4a5568;
}

.stat-item i {
  font-size: 1rem;
}

.stat-item strong {
  font-weight: 700;
}

/* ========== RPG按钮 ========== */
.rpg-button {
  position: relative;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--card-color-start) 0%, var(--card-color-end) 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 4px 12px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.3);
  transition: all 0.3s ease;
}

.rpg-button:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 16px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.4);
}

.rpg-button:active {
  transform: translateY(0);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

.button-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255,255,255,0.4) 50%,
    transparent 60%
  );
  animation: buttonShine 3s ease-in-out infinite;
}

/* ========== 状态面板 ========== */
.rpg-status-panel {
  background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
  border-radius: 16px;
  padding: 1.5rem;
  border: 2px solid rgba(0,0,0,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
}

.rpg-status-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #FFB703 0%, #FFD60A 100%);
  animation: shimmer 3s ease-in-out infinite;
}

.status-panel-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.status-panel-header i {
  font-size: 1.75rem;
  animation: iconPulse 2s ease-in-out infinite;
}

.status-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a202c;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-level {
  margin-left: auto;
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #FFB703 0%, #FFD60A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.status-panel-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ========== 经验值条 ========== */
.exp-bar-container {
  position: relative;
}

.exp-bar-bg {
  position: relative;
  height: 24px;
  background: linear-gradient(to bottom, #e2e8f0 0%, #cbd5e0 100%);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
  margin-bottom: 0.5rem;
}

.exp-bar {
  height: 100%;
  background: linear-gradient(90deg, #FFB703 0%, #FFD60A 50%, #FFB703 100%);
  background-size: 200% 100%;
  border-radius: 12px;
  animation: expGlow 2s ease-in-out infinite;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.5),
    0 2px 8px rgba(255, 183, 3, 0.5);
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.exp-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.7) 50%,
    transparent 100%
  );
  animation: expShine 2s ease-in-out infinite;
}

.exp-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: #4a5568;
  font-weight: 600;
}

.exp-percentage {
  background: linear-gradient(135deg, #FFB703 0%, #FFD60A 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ========== 状态徽章 ========== */
.status-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.6) 0%, rgba(248,250,252,0.6) 100%);
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  font-size: 0.875rem;
  color: #4a5568;
  transition: all 0.3s ease;
}

.stat-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: rgba(0,0,0,0.12);
}

.stat-badge i {
  font-size: 1.25rem;
}

.stat-badge strong {
  font-weight: 700;
  color: #2d3748;
}

/* ========== 动画 ========== */
@keyframes shimmer {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes iconShine {
  0% { transform: translateX(-200%); }
  100% { transform: translateX(200%); }
}

@keyframes barShine {
  0% { left: -100%; }
  100% { left: 200%; }
}

@keyframes buttonShine {
  0% { transform: translateX(-200%) rotate(45deg); }
  100% { transform: translateX(200%) rotate(45deg); }
}

@keyframes expGlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes expShine {
  0% { left: -100%; }
  100% { left: 200%; }
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px currentColor); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 15px currentColor); }
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .rpg-icon-container {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }

  .resource-label {
    font-size: 1rem;
  }

  .resource-value {
    font-size: 2.25rem;
  }

  .status-stats {
    grid-template-columns: 1fr;
  }
}
